```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Git命令手册 - 技术小馆</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', 'Noto Serif SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background-color: #f8fafc;
            color: #1e293b;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .command-code {
            background-color: #1e293b;
            color: #f8fafc;
            border-radius: 0.375rem;
            padding: 0.75rem 1rem;
            font-family: 'Courier New', Courier, monospace;
            position: relative;
        }
        .command-code::before {
            content: '$';
            color: #94a3b8;
            margin-right: 0.5rem;
        }
        .drop-cap::first-letter {
            float: left;
            font-size: 3.5em;
            line-height: 0.8;
            margin: 0.1em 0.2em 0 0;
            color: #3b82f6;
            font-weight: bold;
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-4 md:px-8 lg:px-16">
        <div class="container mx-auto max-w-5xl">
            <div class="flex flex-col items-center text-center">
                <h1 class="text-4xl md:text-5xl lg:text-6xl font-bold mb-6">Git命令完全指南</h1>
                <p class="text-xl md:text-2xl max-w-3xl mb-8 leading-relaxed">
                    掌握这些核心命令，提升你的版本控制能力
                </p>
                <div class="flex space-x-4">
                    <a href="#commands" class="bg-white text-blue-600 hover:bg-blue-50 px-6 py-3 rounded-full font-semibold transition duration-300">
                        开始学习
                    </a>
                    <a href="#visualization" class="border-2 border-white text-white hover:bg-white hover:text-blue-600 px-6 py-3 rounded-full font-semibold transition duration-300">
                        查看可视化
                    </a>
                </div>
            </div>
        </div>
    </section>

    <!-- Introduction -->
    <section class="py-12 px-4 md:px-8 lg:px-16 bg-white">
        <div class="container mx-auto max-w-5xl">
            <div class="prose prose-lg mx-auto">
                <p class="drop-cap text-gray-700 leading-relaxed">
                    Git是一个强大的分布式版本控制系统，它彻底改变了软件开发中的代码管理方式。无论是个人项目还是团队协作，掌握Git命令都能显著提升您的工作效率。本指南精选了15个最常用且最重要的Git命令，每个命令都配有详细说明和实用示例，帮助您快速掌握Git的核心功能。
                </p>
            </div>
        </div>
    </section>

    <!-- Commands Section -->
    <section id="commands" class="py-16 px-4 md:px-8 lg:px-16 bg-gray-50">
        <div class="container mx-auto max-w-5xl">
            <h2 class="text-3xl md:text-4xl font-bold text-center mb-12 text-gray-800">
                <i class="fas fa-terminal mr-3 text-blue-500"></i>核心Git命令
            </h2>
            
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
                <!-- Command 1 -->
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-blue-100 p-3 rounded-full mr-4">
                            <i class="fas fa-play text-blue-600 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-gray-800">git init</h3>
                    </div>
                    <p class="text-gray-600 mb-4">初始化一个新的Git仓库。在项目目录下生成一个.git目录，用于存储版本控制信息。</p>
                    <div class="command-code mb-4">
                        git init
                    </div>
                    <div class="text-sm text-gray-500">
                        <i class="fas fa-lightbulb mr-1"></i> 通常在项目首次创建时使用
                    </div>
                </div>

                <!-- Command 2 -->
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-purple-100 p-3 rounded-full mr-4">
                            <i class="fas fa-copy text-purple-600 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-gray-800">git clone</h3>
                    </div>
                    <p class="text-gray-600 mb-4">克隆一个远程Git仓库到本地。将远程仓库的所有内容(包括历史记录和分支)复制到本地目录中。</p>
                    <div class="command-code mb-4">
                        git clone &lt;repository_url&gt;
                    </div>
                    <div class="text-sm text-gray-500">
                        <i class="fas fa-lightbulb mr-1"></i> 适用于获取远程项目的副本
                    </div>
                </div>

                <!-- Command 3 -->
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-green-100 p-3 rounded-full mr-4">
                            <i class="fas fa-plus text-green-600 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-gray-800">git add</h3>
                    </div>
                    <p class="text-gray-600 mb-4">将文件的更改添加到暂存区。将工作目录中修改过的文件添加到暂存区，以准备提交。</p>
                    <div class="command-code mb-4">
                        git add &lt;file_or_directory&gt;
                    </div>
                    <div class="text-sm text-gray-500">
                        <i class="fas fa-lightbulb mr-1"></i> 使用git add .添加所有更改的文件
                    </div>
                </div>

                <!-- Command 4 -->
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-yellow-100 p-3 rounded-full mr-4">
                            <i class="fas fa-save text-yellow-600 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-gray-800">git commit</h3>
                    </div>
                    <p class="text-gray-600 mb-4">提交暂存区的更改到本地仓库。将暂存区的文件快照记录到本地仓库的历史记录中。</p>
                    <div class="command-code mb-4">
                        git commit -m "commit message"
                    </div>
                    <div class="text-sm text-gray-500">
                        <i class="fas fa-lightbulb mr-1"></i> 需要提供有意义的提交信息
                    </div>
                </div>

                <!-- Command 5 -->
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-red-100 p-3 rounded-full mr-4">
                            <i class="fas fa-info-circle text-red-600 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-gray-800">git status</h3>
                    </div>
                    <p class="text-gray-600 mb-4">显示当前工作目录和暂存区的状态。查看文件的当前状态，包括哪些文件已被修改、哪些文件已被暂存。</p>
                    <div class="command-code mb-4">
                        git status
                    </div>
                    <div class="text-sm text-gray-500">
                        <i class="fas fa-lightbulb mr-1"></i> 快速了解当前变更状态
                    </div>
                </div>

                <!-- Command 6 -->
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-indigo-100 p-3 rounded-full mr-4">
                            <i class="fas fa-code-compare text-indigo-600 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-gray-800">git diff</h3>
                    </div>
                    <p class="text-gray-600 mb-4">查看工作目录和暂存区之间的差异。显示文件的具体更改内容，帮助了解当前的修改。</p>
                    <div class="command-code mb-4">
                        git diff
                    </div>
                    <div class="text-sm text-gray-500">
                        <i class="fas fa-lightbulb mr-1"></i> 使用git diff --cached查看已暂存的更改
                    </div>
                </div>

                <!-- Command 7 -->
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-pink-100 p-3 rounded-full mr-4">
                            <i class="fas fa-history text-pink-600 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-gray-800">git log</h3>
                    </div>
                    <p class="text-gray-600 mb-4">查看提交历史记录。显示项目的提交历史，包括提交ID、作者、日期和提交信息。</p>
                    <div class="command-code mb-4">
                        git log
                    </div>
                    <div class="text-sm text-gray-500">
                        <i class="fas fa-lightbulb mr-1"></i> 使用--oneline简洁模式或--graph图形化显示
                    </div>
                </div>

                <!-- Command 8 -->
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-blue-100 p-3 rounded-full mr-4">
                            <i class="fas fa-code-branch text-blue-600 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-gray-800">git branch</h3>
                    </div>
                    <p class="text-gray-600 mb-4">列出、创建或删除分支。管理分支，包括列出所有分支、创建新分支或删除旧分支。</p>
                    <div class="command-code mb-4">
                        git branch &lt;branch_name&gt;
                    </div>
                    <div class="text-sm text-gray-500">
                        <i class="fas fa-lightbulb mr-1"></i> 使用-d选项删除分支
                    </div>
                </div>

                <!-- Command 9 -->
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-purple-100 p-3 rounded-full mr-4">
                            <i class="fas fa-exchange-alt text-purple-600 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-gray-800">git checkout</h3>
                    </div>
                    <p class="text-gray-600 mb-4">切换分支或恢复文件。切换到指定的分支或恢复文件到某个提交状态。</p>
                    <div class="command-code mb-4">
                        git checkout &lt;branch_name&gt;
                    </div>
                    <div class="text-sm text-gray-500">
                        <i class="fas fa-lightbulb mr-1"></i> 也可以用来检出远程分支
                    </div>
                </div>

                <!-- Command 10 -->
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-green-100 p-3 rounded-full mr-4">
                            <i class="fas fa-code-merge text-green-600 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-gray-800">git merge</h3>
                    </div>
                    <p class="text-gray-600 mb-4">合并两个分支。将一个分支的更改合并到当前分支，生成一个新的合并提交。</p>
                    <div class="command-code mb-4">
                        git merge &lt;branch_name&gt;
                    </div>
                    <div class="text-sm text-gray-500">
                        <i class="fas fa-lightbulb mr-1"></i> 适用于将开发分支的更改合并到主分支
                    </div>
                </div>

                <!-- Command 11 -->
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-yellow-100 p-3 rounded-full mr-4">
                            <i class="fas fa-cloud-download-alt text-yellow-600 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-gray-800">git pull</h3>
                    </div>
                    <p class="text-gray-600 mb-4">从远程仓库获取并合并更新。拉取远程仓库的最新更改并将其合并到当前分支。</p>
                    <div class="command-code mb-4">
                        git pull &lt;remote&gt; &lt;branch&gt;
                    </div>
                    <div class="text-sm text-gray-500">
                        <i class="fas fa-lightbulb mr-1"></i> 等同于git fetch + git merge
                    </div>
                </div>

                <!-- Command 12 -->
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-red-100 p-3 rounded-full mr-4">
                            <i class="fas fa-cloud-upload-alt text-red-600 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-gray-800">git push</h3>
                    </div>
                    <p class="text-gray-600 mb-4">将本地更改推送到远程仓库。将本地仓库中的提交推送到远程仓库，以便其他人能够看到和获取这些更改。</p>
                    <div class="command-code mb-4">
                        git push &lt;remote&gt; &lt;branch&gt;
                    </div>
                    <div class="text-sm text-gray-500">
                        <i class="fas fa-lightbulb mr-1"></i> 分享你的代码变更
                    </div>
                </div>

                <!-- Command 13 -->
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-indigo-100 p-3 rounded-full mr-4">
                            <i class="fas fa-cloud text-indigo-600 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-gray-800">git fetch</h3>
                    </div>
                    <p class="text-gray-600 mb-4">从远程仓库获取更新但不自动合并。拉取远程仓库的最新更改到本地，但不会自动合并。</p>
                    <div class="command-code mb-4">
                        git fetch &lt;remote&gt;
                    </div>
                    <div class="text-sm text-gray-500">
                        <i class="fas fa-lightbulb mr-1"></i> 通常与git merge一起使用
                    </div>
                </div>

                <!-- Command 14 -->
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-pink-100 p-3 rounded-full mr-4">
                            <i class="fas fa-undo text-pink-600 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-gray-800">git reset</h3>
                    </div>
                    <p class="text-gray-600 mb-4">重置当前分支的状态。通过重置暂存区和工作目录，撤销提交、暂存或修改文件。</p>
                    <div class="command-code mb-4">
                        git reset &lt;commit_id&gt;
                    </div>
                    <div class="text-sm text-gray-500">
                        <i class="fas fa-lightbulb mr-1"></i> 使用--hard选项重置工作目录
                    </div>
                </div>

                <!-- Command 15 -->
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-blue-100 p-3 rounded-full mr-4">
                            <i class="fas fa-eraser text-blue-600 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-gray-800">git revert</h3>
                    </div>
                    <p class="text-gray-600 mb-4">反向应用某个提交的更改。创建一个新的提交，用来撤销指定提交的更改，而不改变历史记录。</p>
                    <div class="command-code mb-4">
                        git revert &lt;commit_id&gt;
                    </div>
                    <div class="text-sm text-gray-500">
                        <i class="fas fa-lightbulb mr-1"></i> 适用于撤销不想要的更改
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Visualization Section -->
    <section id="visualization" class="py-16 px-4 md:px-8 lg:px-16 bg-white">
        <div class="container mx-auto max-w-5xl">
            <h2 class="text-3xl md:text-4xl font-bold text-center mb-12 text-gray-800">
                <i class="fas fa-project-diagram mr-3 text-indigo-500"></i>Git工作流程可视化
            </h2>
            
            <div class="bg-gray-50 p-6 rounded-xl shadow-md">
                <div class="mermaid">
                    graph LR
                    A[工作目录] -->|git add| B(暂存区)
                    B -->|git commit| C[本地仓库]
                    C -->|git push| D[远程仓库]
                    D -->|git fetch/clone| C
                    D -->|git pull| A
                    C -->|git checkout/reset| A
                    C -->|git merge| C
                    style A fill:#f0f9ff,stroke:#3b82f6
                    style B fill:#f5f3ff,stroke:#8b5cf6
                    style C fill:#ecfdf5,stroke:#10b981
                    style D fill:#fef2f2,stroke:#ef4444
                </div>
                <div class="mt-6 text-center text-gray-600">
                    <p>上图展示了Git的核心工作流程以及各区域之间的关系。理解这些概念能帮助您更好地运用Git命令。</p>
                </div>
            </div>
        </div>
    </section>

    <!-- Best Practices -->
    <section class="py-16 px-4 md:px-8 lg:px-16 bg-gray-50">
        <div class="container mx-auto max-w-5xl">
            <h2 class="text-3xl md:text-4xl font-bold text-center mb-12 text-gray-800">
                <i class="fas fa-star mr-3 text-yellow-500"></i>Git最佳实践
            </h2>
            
            <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
                <div class="bg-white p-6 rounded-xl shadow-md">
                    <h3 class="text-xl font-bold mb-4 text-gray-800 flex items-center">
                        <i class="fas fa-check-circle text-green-500 mr-3"></i>提交规范
                    </h3>
                    <ul class="space-y-3 text-gray-600">
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mt-1 mr-2"></i>
                            <span>使用有意义的提交信息，说明做了什么变更以及为什么</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mt-1 mr-2"></i>
                            <span>遵循约定式提交规范，如"feat: 添加新功能"、"fix: 修复bug"</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mt-1 mr-2"></i>
                            <span>保持提交原子性，每个提交只做一件事</span>
                        </li>
                    </ul>
                </div>
                
                <div class="bg-white p-6 rounded-xl shadow-md">
                    <h3 class="text-xl font-bold mb-4 text-gray-800 flex items-center">
                        <i class="fas fa-code-branch text-blue-500 mr-3"></i>分支策略
                    </h3>
                    <ul class="space-y-3 text-gray-600">
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mt-1 mr-2"></i>
                            <span>使用功能分支工作流，每个新功能创建一个独立分支</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mt-1 mr-2"></i>
                            <span>主分支(main/master)保持稳定，只接收通过测试的代码</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mt-1 mr-2"></i>
                            <span>使用pull request或merge request进行代码审查</span>
                        </li>
                    </ul>
                </div>
                
                <div class="bg-white p-6 rounded-xl shadow-md">
                    <h3 class="text-xl font-bold mb-4 text-gray-800 flex items-center">
                        <i class="fas fa-history text-purple-500 mr-3"></i>历史记录
                    </h3>
                    <ul class="space-y-3 text-gray-600">
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mt-1 mr-2"></i>
                            <span>定期使用git log查看提交历史</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mt-1 mr-2"></i>
                            <span>使用git rebase -i整理本地提交历史</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mt-1 mr-2"></i>
                            <span>避免修改已推送到远程仓库的历史记录</span>
                        </li>
                    </ul>
                </div>
                
                <div class="bg-white p-6 rounded-xl shadow-md">
                    <h3 class="text-xl font-bold mb-4 text-gray-800 flex items-center">
                        <i class="fas fa-users text-pink-500 mr-3"></i>团队协作
                    </h3>
                    <ul class="space-y-3 text-gray-600">
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mt-1 mr-2"></i>
                            <span>定期拉取(pull)远程变更，减少合并冲突</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mt-1 mr-2"></i>
                            <span>解决冲突时与相关开发者沟通，理解变更上下文</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mt-1 mr-2"></i>
                            <span>使用.gitignore文件排除不应提交的文件</span>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </section>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-8 px-4">
        <div class="container mx-auto max-w-5xl">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-bold text-white">技术小馆</h3>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-gray-300 hover:text-white transition duration-300">
                        <i class="fas fa-external-link-alt mr-2"></i>http://www.yuque.com/jtostring
                    </a>
                </div>
            </div>
            <div class="mt-6 pt-6 border-t border-gray-700 text-center text-sm">
                <p>© 2023 技术小馆. 保留所有权利.</p>
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>
```